#!/bin/bash

tmux has-session -t workspace
if [ $? != 0 ]; then
    tmux new-session -s workspace -n editor -d -e 'VIM_SERVER_NAME=workspace'
    tmux send-keys -t workspace 'vim --servername workspace' C-m
    tmux new-window -n ranger -t workspace 'VIM_SERVER_NAME=workspace ranger ~ /etc /opt'
    tmux select-window -t workspace:2
fi

if [ -z "$TMUX" ]; then
    tmux -u attach-session -t workspace
else
    tmux -u switch-client -t workspace
fi
